//package com.nx.arch.addon.mybatis.config;
//
//import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
//import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
//import org.apache.ibatis.executor.Executor;
//import org.apache.ibatis.mapping.MappedStatement;
//import org.apache.ibatis.plugin.Intercepts;
//import org.apache.ibatis.plugin.Invocation;
//import org.apache.ibatis.plugin.Signature;
//import org.apache.ibatis.session.ResultHandler;
//import org.apache.ibatis.session.RowBounds;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
///**
// *使用拦截器打印 SQL
// * MyBatis-Plus 允许您自定义拦截器来打印 SQL。您可以通过实现 Interceptor 接口并重写 intercept 方法来实现。
// */
//@Intercepts({
//    @Signature(type = Executor.class, method = "query", args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class}),
//    @Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class})
//})
//public class MybatisPlusSqlInterceptor implements org.apache.ibatis.plugin.Interceptor {
//
//    private static final Logger logger = LoggerFactory.getLogger(MybatisPlusSqlInterceptor.class);
//
//    @Override
//    public Object intercept(Invocation invocation) throws Throwable {
//        MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0];
//        String sqlId = mappedStatement.getId();
//        Object parameter = invocation.getArgs()[1];
//        // 打印 SQL
//        logger.debug("SQL ID: {}, Parameter: {}", sqlId, parameter);
//        return invocation.proceed();
//    }
//
//    @Override
//    public Object plugin(Object target) {
//        return org.apache.ibatis.plugin.Plugin.wrap(target, this);
//    }
//
//    @Override
//    public void setProperties(Properties properties) {
//        // Do nothing
//    }
//}
